package com.zatech.cgnci.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zatech.cgnci.project.base.utils.ConvertUtils;
import com.zatech.cgnci.project.entity.CgnciAccidentLimitDO;
import com.zatech.cgnci.project.mapper.CgnciAccidentLimitMapper;
import com.zatech.cgnci.project.service.CgnciAccidentLimitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zatech.cgnci.project.vo.CgnciAccidentLimitVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 事故限额表 服务实现类
 * </p>
 *
 * @author Generator
 * @since 2024-12-17
 */
@Service
public class CgnciAccidentLimitServiceImpl extends ServiceImpl<CgnciAccidentLimitMapper, CgnciAccidentLimitDO> implements CgnciAccidentLimitService {

    @Override
    public List<CgnciAccidentLimitVO> listAccidentLimitByInsuranceId(Long insuranceId) {
        List<CgnciAccidentLimitDO> accidentLimitList = this.list(new LambdaQueryWrapper<CgnciAccidentLimitDO>().eq(CgnciAccidentLimitDO::getBusinessId, insuranceId));
        return ConvertUtils.convert(accidentLimitList, CgnciAccidentLimitVO.class);
    }
}
